class Fruit:
    def __str__(self):
        return "fruit"


class Apple(Fruit):
    def __str__(self):
        return "apple"


class Banana(Fruit):
    def __str__(self):
        return "banana"


class Factory:

    def create(self, fruit):
        if fruit == "apple":
            return Apple()
        if fruit == 'banana':
            return Banana

if __name__ == '__main__':
    factory = Factory()
    print(factory.create("apple"))